<?php

/** the excert more filter**/
function new_excerpt_more($more) {
       global $post;
	return '&nbsp;<a href="'. get_permalink($post->ID) . '">Read the Rest...</a>';
}
add_filter('excerpt_more', 'new_excerpt_more');

/** the excert length filter**/
function new_excerpt_length($length) {
	return 20;
}
add_filter('excerpt_length', 'new_excerpt_length');


/** Tell WordPress to run nmfadi_setup() when the 'after_setup_theme' hook is run. */
add_action( 'after_setup_theme', 'nmfadi_setup' );

if ( ! function_exists( 'nmfadi_setup' ) ):
function nmfadi_setup()
{
	
	register_nav_menus( array(
		'footer' => __( 'Footer Navigation', 'nmfadi' ),
	) );

	// This theme allows users to set a custom background
	add_custom_background();
	
	
}

endif;

/**
 * Register widgetized areas, including two sidebars and four widget-ready columns in the footer.
 *
 * To override nmfadi_widgets_init() in a child theme, remove the action hook and add your own
 * function tied to the init hook.
 *
 * @since Twenty Ten 1.0
 * @uses register_sidebar
 */
 
function nmfadi_widgets_init() {
	// Area 1, located at the top of the sidebar.
	register_sidebar( array(
		'name' => __( 'Right-1', 'nmfadi' ),
		'id' => 'r1-widget-area',
		'description' => __( 'Right side first', 'nmfadi' ),
		'before_widget' => '<ul>',
		'after_widget' => '</ul>',
		'before_title' => '<h1 class="widget-title">',
		'after_title' => '</h1>',
	) );
	
	// Area 2, located at the right side
	register_sidebar( array(
		'name' => __( 'Right-2', 'nmfadi' ),
		'id' => 'r2-widget-area',
		'description' => __( 'Right side second', 'nmfadi' ),
		'before_widget' => '<ul>',
		'after_widget' => '</ul>',
		'before_title' => '<h1 class="widget-title">',
		'after_title' => '</h1>',
	) );
	
	// Area 3, located at the right side
	register_sidebar( array(
		'name' => __( 'Right-3', 'nmfadi' ),
		'id' => 'r3-widget-area',
		'description' => __( 'Right side third', 'nmfadi' ),
		'before_widget' => '<ul>',
		'after_widget' => '</ul>',
		'before_title' => '<h1 class="widget-title">',
		'after_title' => '</h1>',
	) );

}
/** Register sidebars by running nmfadi_widgets_init() on the widgets_init hook. */
add_action( 'widgets_init', 'nmfadi_widgets_init' );


// Theme Options
require_once (TEMPLATEPATH . '/admin/theme_options.php');